home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ATA.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  53.2 KB  |  1,040 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ATA.p
  3.  
  4.      Contains:    ATA (PC/AT Attachment) Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ATA;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __ATA__}
  28. {$SETC __ATA__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ATAIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. { This is the structure used for the AT Interface core routines below }
  48.  
  49. CONST
  50.     kATATrap                    = $AAF1;                        {  Manager trap number <This should be defined in Traps.h> }
  51.     kATAPBVers1                    = $01;                            {  parameter block version number 1 }
  52.     kATAPBVers2                    = $02;                            {  parameter block version number for structures }
  53.     kATAPBVers3                    = $03;                            {  parameter block version for ATA times }
  54.     kATADefaultBlockSize        = 512;                            {  default block size }
  55.  
  56. {  Used to determine the presence of traps }
  57.     kFSMTrap                    = $AC;
  58.     mDQEChanged                    = 1;                            {  DQE has changed  }
  59.  
  60. {  Task file definition ••• Error Register ••• }
  61.     bATABadBlock                = 7;                            {  bit number of bad block error bit }
  62.     bATAUncorrectable            = 6;                            {  bit number of uncorrectable error bit }
  63.     bATAMediaChanged            = 5;                            {  bit number of media changed indicator }
  64.     bATAIDNotFound                = 4;                            {  bit number of ID not found error bit }
  65.     bATAMediaChangeReq            = 3;                            {  bit number of media changed request }
  66.     bATACommandAborted            = 2;                            {  bit number of command abort bit }
  67.     bATATrack0NotFound            = 1;                            {  bit number of track not found }
  68.     bATAAddressNotFound            = 0;                            {  bit number of address mark not found }
  69.     mATABadBlock                = $80;                            {  Bad Block Detected }
  70.     mATAUncorrectable            = $40;                            {  Uncorrectable Data Error }
  71.     mATAMediaChanged            = $20;                            {  Media Changed Indicator (for removable) }
  72.     mATAIDNotFound                = $10;                            {  ID Not Found }
  73.     mATAMediaChangeReq            = $08;                            {  Media Change Requested (NOT IMPLEMENTED) }
  74.     mATACommandAborted            = $04;                            {  Aborted Command }
  75.     mATATrack0NotFound            = $02;                            {  Track 0 Not Found }
  76.     mATAAddressNotFound            = $01;                            {  Address Mark Not Found }
  77.  
  78. {  Task file definition ••• Features register ••• }
  79.     bATAPIuseDMA                = 0;                            {  bit number of useDMA bit (ATAPI) }
  80.     mATAPIuseDMA                = $01;
  81.  
  82. {  Task file definition ••• ataTFSDH Register ••• }
  83.     mATAHeadNumber                = $0F;                            {  Head Number (bits 0-3)  }
  84.     mATASectorSize                = $A0;                            {  bit 7=1; bit 5 = 01 (512 sector size) <DP4> }
  85.     mATADriveSelect                = $10;                            {  Drive (0 = master, 1 = slave)  }
  86.     mATALBASelect                = $40;                            {  LBA mode bit (0 = chs, 1 = LBA) }
  87.  
  88. {  Task file definition ••• Status Register ••• }
  89.     bATABusy                    = 7;                            {  bit number of BSY bit }
  90.     bATADriveReady                = 6;                            {  bit number of drive ready bit }
  91.     bATAWriteFault                = 5;                            {  bit number of write fault bit }
  92.     bATASeekComplete            = 4;                            {  bit number of seek complete bit }
  93.     bATADataRequest                = 3;                            {  bit number of data request bit }
  94.     bATADataCorrected            = 2;                            {  bit number of data corrected bit }
  95.     bATAIndex                    = 1;                            {  bit number of index mark }
  96.     bATAError                    = 0;                            {  bit number of error bit }
  97.     mATABusy                    = $80;                            {  Unit is busy }
  98.     mATADriveReady                = $40;                            {  Unit is ready }
  99.     mATAWriteFault                = $20;                            {  Unit has a write fault condition }
  100.     mATASeekComplete            = $10;                            {  Unit seek complete }
  101.     mATADataRequest                = $08;                            {  Unit data request }
  102.     mATADataCorrected            = $04;                            {  Data corrected }
  103.     mATAIndex                    = $02;                            {  Index mark - NOT USED }
  104.     mATAError                    = $01;                            {  Error condition - see error register }
  105.  
  106. {  Task file definition ••• Device Control Register ••• }
  107.     bATADCROne                    = 3;                            {  bit number of always one bit }
  108.     bATADCRReset                = 2;                            {  bit number of reset bit }
  109.     bATADCRnIntEnable            = 1;                            {  bit number of interrupt disable }
  110.     mATADCROne                    = $08;                            {  always one bit }
  111.     mATADCRReset                = $04;                            {  Reset (1 = reset) }
  112.     mATADCRnIntEnable            = $02;                            {  Interrupt Disable(0 = enabled) }
  113.  
  114. {  ATA Command Opcode definition }
  115.     kATAcmdWORetry                = $01;                            {  Without I/O retry option }
  116.     kATAcmdNOP                    = $0000;                        {  NOP operation - media detect }
  117.     kATAcmdRecal                = $0010;                        {  Recalibrate command  }
  118.     kATAcmdRead                    = $0020;                        {  Read command  }
  119.     kATAcmdReadLong                = $0022;                        {  Read Long command }
  120.     kATAcmdWrite                = $0030;                        {  Write command  }
  121.     kATAcmdWriteLong            = $0032;                        {  Write Long }
  122.     kATAcmdWriteVerify            = $003C;                        {  Write verify }
  123.     kATAcmdReadVerify            = $0040;                        {  Read Verify command  }
  124.     kATAcmdFormatTrack            = $0050;                        {  Format Track command  }
  125.     kATAcmdSeek                    = $0070;                        {  Seek command  }
  126.     kATAcmdDiagnostic            = $0090;                        {  Drive Diagnostic command  }
  127.     kATAcmdInitDrive            = $0091;                        {  Init drive parameters command  }
  128.     kATAcmdReadMultiple            = $00C4;                        {  Read multiple }
  129.     kATAcmdWriteMultiple        = $00C5;                        {  Write multiple }
  130.     kATAcmdSetRWMultiple        = $00C6;                        {  Set Multiple for Read/Write Multiple }
  131.     kATAcmdReadDMA                = $00C8;                        {  Read DMA (with retries) }
  132.     kATAcmdWriteDMA                = $00CA;                        {  Write DMA (with retries) }
  133.     kATAcmdMCAcknowledge        = $00DB;                        {  Acknowledge media change - removable }
  134.     kATAcmdDoorLock                = $00DE;                        {  Door lock }
  135.     kATAcmdDoorUnlock            = $00DF;                        {  Door unlock }
  136.     kATAcmdStandbyImmed            = $00E0;                        {  Standby Immediate }
  137.     kATAcmdIdleImmed            = $00E1;                        {  Idle Immediate }
  138.     kATAcmdStandby                = $00E2;                        {  Standby }
  139.     kATAcmdIdle                    = $00E3;                        {  Idle }
  140.     kATAcmdReadBuffer            = $00E4;                        {  Read sector buffer command  }
  141.     kATAcmdCheckPowerMode        = $00E5;                        {  Check power mode command    <04/04/94> }
  142.     kATAcmdSleep                = $00E6;                        {  Sleep }
  143.     kATAcmdWriteBuffer            = $00E8;                        {  Write sector buffer command  }
  144.     kATAcmdWriteSame            = $00E9;                        {  Write same data to multiple sectors }
  145.     kATAcmdDriveIdentify        = $00EC;                        {  Identify Drive command  }
  146.     kATAcmdMediaEject            = $00ED;                        {  Media Eject }
  147.     kATAcmdSetFeatures            = $00EF;                        {  Set Features }
  148.  
  149. {  Set feature command opcodes }
  150.     kATAEnableWriteCache        = $02;                            {         Enable write cache }
  151.     kATASetTransferMode            = $03;                            {         Set transfer mode }
  152.     kATASetPIOMode                = $08;                            {         PIO Flow Control Tx Mode bit }
  153.     kATAEnableECC                = $88;                            {         ECC enable }
  154.     kATAEnableRetry                = $99;                            {         Retry enable }
  155.     kATAEnableReadAhead            = $AA;                            {         Read look-ahead enable }
  156.  
  157. {
  158.   --------------------------------------------------------------------------------
  159.    enums for dealing with device IDs
  160. }
  161.  
  162.     kATABusIDMask                = $000000FF;
  163.     kATADeviceIDMask            = $0000FF00;
  164.     kATADeviceIDClippingMask    = $0000FFFF;
  165.     kMinBusID                    = $00000000;
  166.     kMaxBusID                    = $000000FE;
  167.  
  168.     kATAStartIterateDeviceID    = $FFFF;
  169.     kATAEndIterateDeviceID        = $FF;
  170.  
  171. { -------------------------------------------------------------------------------- }
  172. { Device Register Images  (8 bytes) }
  173.  
  174. TYPE
  175.     ataTaskFilePtr = ^ataTaskFile;
  176.     ataTaskFile = RECORD
  177.         ataTFFeatures:            SInt8;                                    {  <-> Error(R) or ataTFFeatures(W) register image  }
  178.         ataTFCount:                SInt8;                                    {  <-> Sector count/remaining  }
  179.         ataTFSector:            SInt8;                                    {  <-> Sector start/finish  }
  180.         ataTFReserved:            SInt8;                                    {  reserved                     }
  181.         ataTFCylinder:            UInt16;                                    {  <-> ataTFCylinder (Big endian)  }
  182.         ataTFSDH:                SInt8;                                    {  <-> ataTFSDH register image }
  183.         ataTFCommand:            SInt8;                                    {  <-> Status(R) or Command(W) register image  }
  184.     END;
  185.  
  186. {  ATA Manager Function Code Definition }
  187.  
  188. CONST
  189.     kATAMgrNOP                    = $00;                            {  No Operation }
  190.     kATAMgrExecIO                = $01;                            {  Execute ATA I/O }
  191.     kATAMgrBusInquiry            = $03;                            {  Bus Inquiry }
  192.     kATAMgrQRelease                = $04;                            {  I/O Queue Release }
  193.     kATAMgrAbort                = $10;                            {  Abort command }
  194.     kATAMgrBusReset                = $11;                            {  Reset ATA bus }
  195.     kATAMgrRegAccess            = $12;                            {  Register Access }
  196.     kATAMgrDriveIdentify        = $13;                            {  Drive Identify            <DP03/10/94> }
  197.     kATAMgrDriverLoad            = $82;                            {  Load driver from either Media, ROM, etc. }
  198.     kATAMgrDriveRegister        = $85;                            {  Register a driver        <4/18/94> }
  199.     kATAMgrFindDriverRefnum        = $86;                            {  lookup a driver refnum    <4/18/94> }
  200.     kATAMgrRemoveDriverRefnum    = $87;                            {  De-register a driver    <4/18/94> }
  201.     kATAMgrModifyEventMask        = $88;                            {  Modify driver event mask }
  202.     kATAMgrDriveEject            = $89;                            {  Eject the drive        <8/1/94> }
  203.     kATAMgrGetDrvConfiguration    = $8A;                            {  Get device configuration    <8/6/94> }
  204.     kATAMgrSetDrvConfiguration    = $8B;                            {  Set device configuration <8/6/94> }
  205.     kATAMgrGetLocationIcon        = $8C;                            {  Get card location icon    <SM4> }
  206.     kATAMgrManagerInquiry        = $90;                            {  Manager Inquiry }
  207.     kATAMgrManagerInit            = $91;                            {  Manager initialization }
  208.     kATAMgrManagerShutdown        = $92;                            {  Manager ShutDown }
  209.                                                                 {  note: functions 0x93 to 0x97 are reserved }
  210.     kATAMgrFindSpecialDriverRefnum = $98;                        {  lookup a driver refnum; driverloader,notify-all or ROM driver. }
  211.     kATAMgrNextAvailable        = $99;
  212.  
  213. {  used in the ataDrvrFlags field for kATAMgrDriveRegister,kATAMgrRemoveDriverRefnum & kATAMgrFindSpecialDriverRefnum }
  214.     kATANotifyAllDriver            = 0;                            {  Notify-All driver }
  215.     kATADriverLoader            = 1;                            {  Driver loader driver         }
  216.     kATAROMDriver                = 2;                            {  ROM driver }
  217.  
  218. {  'ATAFlags' field of the PB header definition }
  219.     bATAFlagUseConfigSpeed        = 15;                            {  bit number of use default speed flag }
  220.     bATAFlagByteSwap            = 14;                            {  bit number of byte swap flag }
  221.     bATAFlagIORead                = 13;                            {  bit number of I/O read flag }
  222.     bATAFlagIOWrite                = 12;                            {  bit number of I/O write flag }
  223.     bATAFlagImmediate            = 11;                            {  bit number of immediate flag }
  224.     bATAFlagQLock                = 10;                            {  bit number of que lock on error }
  225.     bATAFlagScatterGather1        = 9;                            {  bit number of scatter gather }
  226.     bATAFlagScatterGather0        = 8;                            {  bit numbers of scatter gather }
  227.     bATAFlagUseDMA                = 7;                            {  bit number of use DMA flag }
  228.     bATAFlagProtocol1            = 5;                            {  bit number of scatter gather }
  229.     bATAFlagProtocol0            = 4;                            {  bit numbers of protocol specifier }
  230.     bATAFlagTFRead                = 3;                            {  bit number of register update }
  231.     bATAFlagLEDEnable            = 0;                            {  bit number of LED enable }
  232.     mATAFlagUseConfigSpeed        = $8000;
  233.     mATAFlagByteSwap            = $4000;                        {  Swap data bytes (read - after; write - before) }
  234.     mATAFlagIORead                = $2000;                        {  Read (in) operation }
  235.     mATAFlagIOWrite                = $1000;                        {  Write (out) operation }
  236.     mATAFlagImmediate            = $0800;                        {  Head of Que; Immediate operation }
  237.     mATAFlagQLock                = $0400;                        {  Manager queue lock on error (freeze the queue) }
  238.     mATAFlagScatterGather1        = $0200;
  239.     mATAFlagScatterGather0        = $0100;                        {  Scatter gather enable }
  240.     mATAFlagScatterGathers        = $0300;                        {  host scatter gather type = currently type 1 supported }
  241.     mATAFlagUseDMA                = $80;
  242.     mATAFlagProtocol1            = $20;                            {  ATAPI protocol indicator <06/15/94> }
  243.     mATAFlagProtocol0            = $10;                            {  PCMCIA protocol indicator <06/15/94> }
  244.     mATAFlagProtocols            = $30;                            {  mask for protocol type field    <06/15/94> }
  245.     mATAFlagTFRead                = $08;                            {  update reg block request upon detection of an error }
  246.     mATAFlagLEDEnable            = $01;                            {  socket LED enable }
  247.  
  248.  
  249.  
  250. TYPE
  251.     ataPBHeaderPtr = ^ataPBHeader;
  252.     ataPBHeader = RECORD
  253.                                                                         {  Start of cloned common header ataPBHdr  }
  254.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  255.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  256.         ataPBVers:                SInt8;                                    {  -->: parameter block version number }
  257.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  258.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  259.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  260.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  261.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  262.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  263.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  264.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  265.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  266.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  267.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  268.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  269.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  270.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  271.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  272.                                                                         {  End of cloned common header ataPBHdr }
  273.     END;
  274.  
  275. {  data request entry structure (16 bytes) }
  276.     IOBlockPtr = ^IOBlock;
  277.     IOBlock = RECORD
  278.         ataPBBuffer:            Ptr;                                    {  -->: Data buffer pointer }
  279.         ataPBByteCount:            UInt32;                                    {  -->: Data transfer length in bytes }
  280.     END;
  281.  
  282. {
  283.    For ATAPI devices the ExtendedPB field is a pointer to the Command Packet
  284.    record which exists of an array of words structured as follows…    <06/15/94>
  285. }
  286.     ATAPICmdPacketPtr = ^ATAPICmdPacket;
  287.     ATAPICmdPacket = RECORD
  288.         atapiPacketSize:        SInt16;                                    {  Size of command packet in bytes    <06/15/94> }
  289.         atapiCommandByte:        ARRAY [0..7] OF SInt16;                    {  The command packet itself    <06/15/94> }
  290.     END;
  291.  
  292. {  Manager parameter block structure (96 bytes) }
  293.     ataIOPBPtr = ^ataIOPB;
  294.     ataIOPB = RECORD
  295.                                                                         {  Start of cloned common header ataPBHdr }
  296.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  297.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  298.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  299.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  300.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  301.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  302.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  303.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  304.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  305.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  306.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  307.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  308.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  309.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  310.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  311.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  312.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  313.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  314.                                                                         {  End of cloned common header ataPBHdr }
  315.         ataPBStatusRegister:    SInt8;                                    {  <--: Last ATA status image }
  316.         ataPBErrorRegister:        SInt8;                                    {  <--: Last ATA error image-valid if lsb of Status set }
  317.         ataPBReserved5:            SInt16;                                    {  Reserved }
  318.         ataPBLogicalBlockSize:    UInt32;                                    {  -->: Blind transfer size per interrupt (Logical block size) }
  319.         ataPBBuffer:            Ptr;                                    {  -->: Data buffer pointer }
  320.         ataPBByteCount:            UInt32;                                    {  -->: Data transfer length in bytes }
  321.         ataPBActualTxCount:        UInt32;                                    {  <--: Actual transfer count }
  322.         ataPBReserved6:            UInt32;                                    {  Reserved }
  323.         ataPBTaskFile:            ataTaskFile;                            {  <->:    Device register images }
  324.         ataPBPacketPtr:            ATAPICmdPacketPtr;                        {  -->: ATAPI packet command block pointer (valid with ATAPI bit set) }
  325.         ataPBReserved7:            ARRAY [0..5] OF SInt16;                    {  Reserved for future expansion }
  326.     END;
  327.  
  328. {  Parameter block structure for bus and Manager inquiry command }
  329. {  Manager parameter block structure }
  330.     ataBusInquiryPtr = ^ataBusInquiry;
  331.     ataBusInquiry = RECORD
  332.                                                                         {  Start of cloned common header ataPBHdr }
  333.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  334.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  335.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  336.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  337.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  338.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  339.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  340.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  341.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  342.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  343.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  344.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  345.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  346.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  347.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  348.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  349.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  350.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  351.                                                                         {  End of cloned common header ataPBHdr }
  352.         ataEngineCount:            UInt16;                                    {  <--: TBD; zero for now }
  353.         ataReserved1:            UInt16;                                    {  Reserved }
  354.         ataDataTypes:            UInt32;                                    {  <--: TBD; zero for now }
  355.         ataIOpbSize:            UInt16;                                    {  <--: Size of ATA IO PB }
  356.         ataMaxIOpbSize:            UInt16;                                    {  <--: TBD; zero for now }
  357.         ataFeatureFlags:        UInt32;                                    {  <--: TBD }
  358.         ataVersionNum:            SInt8;                                    {  <--: Version number for the HBA }
  359.         ataHBAInquiry:            SInt8;                                    {  <--: TBD; zero for now }
  360.         ataReserved2:            UInt16;                                    {  Reserved }
  361.         ataHBAPrivPtr:            UInt32;                                    {  <--: Ptr to HBA private data area }
  362.         ataHBAPrivSize:            UInt32;                                    {  <--: Size of HBA private data area }
  363.         ataAsyncFlags:            UInt32;                                    {  <--: Event capability for callback }
  364.         ataPIOModes:            SInt8;                                    {  <--: PIO modes supported (bit-significant) }
  365.         ataReserved3:            SInt8;                                    {  Reserved }
  366.         ataSingleDMAModes:        SInt8;                                    {  <--: Single Word DMA modes supported (b-sig)     }
  367.         ataMultiDMAModes:        SInt8;                                    {  <--: Multiword DMA modes supported (b-sig) }
  368.         ataReserved4:            ARRAY [0..3] OF UInt32;                    {  Reserved }
  369.         ataReserved5:            ARRAY [0..15] OF SInt8;                    {  TBD }
  370.         ataHBAVendor:            ARRAY [0..15] OF SInt8;                    {  <--: Vendor ID of the HBA }
  371.         ataContrlFamily:        ARRAY [0..15] OF SInt8;                    {  <--: Family of ATA Controller }
  372.         ataContrlType:            ARRAY [0..15] OF SInt8;                    {  <--: Model number of controller }
  373.         ataXPTversion:            ARRAY [0..3] OF SInt8;                    {  <--: version number of XPT }
  374.         ataReserved6:            ARRAY [0..3] OF SInt8;                    {  Reserved }
  375.         ataHBAversion:            NumVersion;                                {  <--: version number of HBA }
  376.         ataHBAslotType:            SInt8;                                    {  <--: type of slot }
  377.         ataHBAslotNum:            SInt8;                                    {  <--: slot number of the HBA }
  378.         ataReserved7:            UInt16;                                    {  Reserved }
  379.         ataReserved8:            UInt32;                                    {  Reserved }
  380.     END;
  381.  
  382. {  Manager parameter block structure }
  383.     ataMgrInquiryPtr = ^ataMgrInquiry;
  384.     ataMgrInquiry = RECORD
  385.                                                                         {  Start of cloned common header ataPBHdr }
  386.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  387.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  388.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  389.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  390.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  391.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  392.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  393.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  394.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  395.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  396.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  397.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  398.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  399.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  400.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  401.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  402.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  403.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  404.                                                                         {  End of cloned common header ataPBHdr }
  405.         ataMgrVersion:            NumVersion;                                {  Manager Version information }
  406.         ataMgrPBVers:            SInt8;                                    {  <--: Manager PB version number supported }
  407.         Reserved1:                SInt8;                                    {  Reserved }
  408.         ataBusCnt:                UInt16;                                    {  <--: Number of ATA buses in the system }
  409.         ataDevCnt:                UInt16;                                    {  <--: Total number of ATA devices detected }
  410.         ataPioModes:            SInt8;                                    {  <--: Maximum Programmed I/O speed mode supported }
  411.         Reserved2:                SInt8;                                    {  Reserved }
  412.         ataIOClkResolution:        UInt16;                                    {  <--: IO Clock resolution in nsec (Not supported) }
  413.         ataSingleDMAModes:        SInt8;                                    {  <--: Single Word DMA modes supported     }
  414.         ataMultiDMAModes:        SInt8;                                    {  <--: Multiword DMA modes supported }
  415.         Reserved:                ARRAY [0..15] OF SInt16;                {  Reserved for future expansion }
  416.     END;
  417.  
  418. {  Parameter block structure for Abort command }
  419. {  Manager parameter block structure }
  420.     ataAbortPtr = ^ataAbort;
  421.     ataAbort = RECORD
  422.                                                                         {  Start of cloned common header ataPBHdr }
  423.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  424.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  425.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  426.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  427.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  428.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  429.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  430.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  431.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  432.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  433.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  434.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  435.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  436.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  437.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  438.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  439.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  440.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  441.                                                                         {  End of cloned common header ataPBHdr }
  442.         ataAbortPB:                ataIOPBPtr;                                {  -->: Parameter block to be aborted }
  443.         Reserved:                ARRAY [0..21] OF SInt16;                {  Reserved for future expansion }
  444.     END;
  445.  
  446. {  Manager parameter block structure }
  447.     ATAEventRecPtr = ^ATAEventRec;
  448.     ATAEventRec = RECORD
  449.         ataEventCode:            UInt16;                                    {  --> ATA event code }
  450.         ataPhysicalID:            UInt16;                                    {  --> Physical drive reference }
  451.         ataDrvrContext:            SInt32;                                    {  Context pointer saved by driver }
  452.         ataMarker:                UInt32;                                    {  Always 'LOAD' }
  453.         ataEventRecVersion:        UInt32;                                    {  Version number of this data structure }
  454.         ataDeviceType:            UInt32;                                    {  Device type on bus (valid for load driver only) }
  455.         ataRefNum:                UInt16;                                    {  RefNum of driver (valid for remove driver only) }
  456.     END;
  457.  
  458.     ATAClientProcPtr = ProcPtr;  { FUNCTION ATAClient(ataERPtr: ATAEventRecPtr): SInt16; }
  459.  
  460.     ATAClientUPP = UniversalProcPtr;
  461.  
  462. CONST
  463.     uppATAClientProcInfo = $000000E0;
  464.  
  465. FUNCTION NewATAClientProc(userRoutine: ATAClientProcPtr): ATAClientUPP;
  466.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  467.     INLINE $2E9F;
  468.     {$ENDC}
  469.  
  470. FUNCTION CallATAClientProc(ataERPtr: ATAEventRecPtr; userRoutine: ATAClientUPP): SInt16;
  471.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  472.     INLINE $205F, $4E90;
  473.     {$ENDC}
  474. {  Parameter block structure for Driver Register command }
  475. {  Manager parameter block structure }
  476.  
  477. TYPE
  478.     ataDrvrRegisterPtr = ^ataDrvrRegister;
  479.     ataDrvrRegister = RECORD
  480.                                                                         {  Start of cloned common header ataPBHdr }
  481.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  482.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  483.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  484.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  485.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  486.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  487.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  488.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  489.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  490.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  491.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  492.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  493.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  494.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  495.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  496.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  497.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  498.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  499.                                                                         {  End of cloned common header ataPBHdr }
  500.         ataDrvrRefNum:            SInt16;                                    {  <->: Driver reference number }
  501.         ataDrvrFlags:            UInt16;                                    {  -->: 1 = loader driver if ataPBDeviceID = -1 (PB2) }
  502.         ataDeviceNextID:        UInt16;                                    {  <--: used to specified the next drive ID }
  503.         ataDrvrLoadPriv:        SInt16;                                    {  Driver loader private storage }
  504.         ataEventHandler:        ATAClientUPP;                            {  <->: Pointer to ATA event callback routine (PB2) }
  505.         ataDrvrContext:            SInt32;                                    {  <->: Context data saved by driver (PB2) }
  506.         ataEventMask:            SInt32;                                    {  <->: Set to 1 for notification of event (PB2) }
  507.         Reserved:                ARRAY [0..13] OF SInt16;                {  Reserved for future expansion - from [21] (PB2) }
  508.     END;
  509.  
  510. {  Parameter block structure for Modify driver event mask command }
  511.     ataModifyEventMaskPtr = ^ataModifyEventMask;
  512.     ataModifyEventMask = RECORD
  513.                                                                         {  Start of cloned common header ataPBHdr }
  514.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  515.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  516.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  517.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  518.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  519.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  520.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  521.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  522.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  523.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  524.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  525.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  526.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  527.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  528.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  529.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  530.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  531.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  532.                                                                         {  End of cloned common header ataPBHdr }
  533.         ataModifiedEventMask:    SInt32;                                    {  -->: new event mask value }
  534.         Reserved:                ARRAY [0..21] OF SInt16;                {  Reserved for future expansion }
  535.     END;
  536.  
  537. {  'ataRegMask' field of the ataRegAccess definition }
  538.  
  539. CONST
  540.     bATAAltSDevCValid            = 14;                            {  bit number of alternate status/device cntrl valid bit }
  541.     bATAStatusCmdValid            = 7;                            {  bit number of status/command valid bit }
  542.     bATASDHValid                = 6;                            {  bit number of ataTFSDH valid bit }
  543.     bATACylinderHiValid            = 5;                            {  bit number of cylinder high valid bit }
  544.     bATACylinderLoValid            = 4;                            {  bit number of cylinder low valid bit }
  545.     bATASectorNumValid            = 3;                            {  bit number of sector number valid bit }
  546.     bATASectorCntValid            = 2;                            {  bit number of sector count valid bit }
  547.     bATAErrFeaturesValid        = 1;                            {  bit number of error/features valid bit }
  548.     bATADataValid                = 0;                            {  bit number of data valid bit }
  549.     mATAAltSDevCValid            = $4000;                        {  alternate status/device control valid }
  550.     mATAStatusCmdValid            = $80;                            {  status/command valid }
  551.     mATASDHValid                = $40;                            {  ataTFSDH valid }
  552.     mATACylinderHiValid            = $20;                            {  cylinder high valid }
  553.     mATACylinderLoValid            = $10;                            {  cylinder low valid }
  554.     mATASectorNumValid            = $08;                            {  sector number valid }
  555.     mATASectorCntValid            = $04;                            {  sector count valid }
  556.     mATAErrFeaturesValid        = $02;                            {  error/features valid }
  557.     mATADataValid                = $01;                            {  data valid }
  558.  
  559. {  Parameter block structure for device register access command }
  560.  
  561. TYPE
  562.     ataRegValueUnionPtr = ^ataRegValueUnion;
  563.     ataRegValueUnion = RECORD
  564.         CASE INTEGER OF
  565.         0: (
  566.             ataByteRegValue:    SInt8;                                    {  <->: Byte register value read or to be written }
  567.             );
  568.         1: (
  569.             ataWordRegValue:    UInt16;                                    {  <->: Word register value read or to be written }
  570.             );
  571.     END;
  572.  
  573. {  Manager parameter block structure }
  574.     ataRegAccessPtr = ^ataRegAccess;
  575.     ataRegAccess = RECORD
  576.                                                                         {  Start of cloned common header ataPBHdr }
  577.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  578.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  579.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  580.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  581.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  582.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  583.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  584.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  585.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  586.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  587.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  588.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  589.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  590.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  591.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  592.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  593.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  594.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  595.                                                                         {  End of cloned common header ataPBHdr }
  596.         ataRegSelect:            UInt16;                                    {  -->: Device Register Selector }
  597.                                                                         {             DataReg            0     }
  598.                                                                         {             ErrorReg(R) or FeaturesReg(W)    1 }
  599.                                                                         {             SecCntReg        2 }
  600.                                                                         {             SecNumReg        3 }
  601.                                                                         {             CylLoReg        4 }
  602.                                                                         {             CylHiReg        5 }
  603.                                                                         {             SDHReg            6 }
  604.                                                                         {             StatusReg(R) or CmdReg(W)        7 }
  605.                                                                         {             AltStatus(R) or DevCntr(W)    0E }
  606.         ataRegValue:            ataRegValueUnion;
  607.                                                                         {  Following fields are valid only if ataRegSelect = 0xFFFF }
  608.         ataRegMask:                UInt16;                                    {  -->: mask for register(s) to update }
  609.                                                                         {         bit 0 : data register valid }
  610.                                                                         {         bit 1 : error/feaures register valid }
  611.                                                                         {         bit 2 : sector count register valid }
  612.                                                                         {         bit 3 : sector number register valid }
  613.                                                                         {         bit 4 : cylinder low register valid }
  614.                                                                         {         bit 5 : cylinder high register valid }
  615.                                                                         {         bit 6 : ataTFSDH register valid }
  616.                                                                         {         bit 7 : status/command register valid }
  617.                                                                         {         bits 8 - 13 : reserved (set to 0) }
  618.                                                                         {         bit 14: alternate status / device control reg valid }
  619.                                                                         {          bit 15: reserved (set to 0) }
  620.         ataRegisterImage:        ataTaskFile;                            {  <->: register images }
  621.         ataAltSDevCReg:            SInt8;                                    {  <->: Alternate status(R) or Device Control(W) register image }
  622.         Reserved3:                SInt8;                                    {  Reserved }
  623.         Reserved:                ARRAY [0..15] OF SInt16;                {  Reserved for future expansion }
  624.     END;
  625.  
  626. {  Manager parameter block structure    <DP03/10/94> }
  627.     ataIdentifyPtr = ^ataIdentify;
  628.     ataIdentify = RECORD
  629.                                                                         {  Start of cloned common header ataPBHdr }
  630.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  631.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  632.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  633.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  634.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  635.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  636.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  637.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  638.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  639.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  640.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  641.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  642.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  643.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  644.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  645.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  646.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  647.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  648.                                                                         {  End of cloned common header ataPBHdr }
  649.         Reserved1:                ARRAY [0..3] OF UInt16;                    {  Reserved.  These are used internally by the Manager }
  650.         ataPBBuffer:            Ptr;                                    {  Buffer for the identify data (512 bytes) }
  651.         Reserved2:                ARRAY [0..11] OF UInt16;                {  Used internally by the ATA Manager }
  652.         Reserved3:                ARRAY [0..5] OF SInt16;                    {  Reserved for future expansion }
  653.     END;
  654.  
  655. {  'ataConfigSetting' field of the Get/Set Device Configuration definition <8/6/94> }
  656.  
  657. CONST
  658.     ATAPIpacketDRQ_bit            = 6;                            {  bit number of ATAPI command packet DRQ option }
  659.     ATAPIpacketDRQ                = $40;                            {  ATAPI command packet DRQ option }
  660.  
  661. {  atapcValid field definition }
  662.     bATApcAccessMode            = 0;
  663.     bATApcVcc                    = 1;
  664.     bATApcVpp1                    = 2;
  665.     bATApcVpp2                    = 3;
  666.     bATApcStatus                = 4;
  667.     bATApcPin                    = 5;
  668.     bATApcCopy                    = 6;
  669.     bATApcConfigIndex            = 7;
  670.     bATApcLockUnlock            = 15;
  671.     mATApcAccessMode            = $01;
  672.     mATApcVcc                    = $02;
  673.     mATApcVpp1                    = $04;
  674.     mATApcVpp2                    = $08;
  675.     mATApcStatus                = $10;
  676.     mATApcPin                    = $20;
  677.     mATApcCopy                    = $40;
  678.     mATApcConfigIndex            = $80;
  679.     mATApcLockUnlock            = $8000;
  680.  
  681. {  Device physical type & socket type indicator definition }
  682.     kATADeviceUnknown            = $00;                            {  no device or type undetermined }
  683.     kATADeviceATA                = $01;                            {  traditional ATA protocol device <7/29/94> }
  684.     kATADeviceATAPI                = $02;                            {  ATAPI protocol device    <7/29/94> }
  685.     kATADeviceReserved            = $03;                            {  reserved by Apple (was PCMCIA) }
  686.  
  687.     kATASocketInternal            = $01;                            {  Internal ATA socket }
  688.     kATASocketMB                = $02;                            {  Media Bay socket }
  689.     kATASocketPCMCIA            = $03;                            {  PCMCIA socket }
  690.  
  691. {  reserved words at the end of the devConfig structure }
  692.     kATAConfigReserved            = 7;                            {  number of reserved words at the end }
  693.  
  694. {
  695.    Get/Set Device Configuration parameter block structure <8/6/94>
  696.    Manager parameter block structure
  697. }
  698.  
  699. TYPE
  700.     ataDevConfigurationPtr = ^ataDevConfiguration;
  701.     ataDevConfiguration = RECORD
  702.                                                                         {  Start of cloned common header ataPBHdr }
  703.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  704.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  705.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  706.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  707.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  708.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  709.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  710.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  711.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  712.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  713.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  714.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  715.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  716.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  717.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  718.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  719.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  720.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  721.                                                                         {  End of cloned common header ataPBHdr }
  722.         ataConfigSetting:        SInt32;                                    {  <->: Configuration setting }
  723.                                                                         {       Bits 3 - 0: Reserved }
  724.                                                                         {       Bit 4: Reserved (allowLBAAccess) }
  725.                                                                         {       Bit 5: Reserved (allowRWMultiple) }
  726.                                                                         {       Bit 6: ATAPIpacketDRQ }
  727.                                                                         {         1 = Check for Interrupt DRQ on ATAPI command packet DRQ }
  728.                                                                         {         0 = Default: Check only for the assertion of command packet DRQ }
  729.                                                                         {       Bits 31 - 7: Reserved }
  730.         ataPIOSpeedMode:        SInt8;                                    {  <->: Device access speed in PIO Mode }
  731.         Reserved3:                SInt8;                                    {  Reserved to force word alignment }
  732.         atapcValid:                UInt16;                                    {  <->: Set when pcXXX fields are valid (atapcAccessMode - atapcConfigIndex) }
  733.                                                                         {         bit 0 - atapcAccessMode field valid, when set }
  734.                                                                         {         bit 1 - atapcVcc field valid, when set }
  735.                                                                         {         bit 2 - atapcVpp1 field valid, when set }
  736.                                                                         {         bit 3 - atapcVpp2 field valid, when set }
  737.                                                                         {         bit 4 - atapcStatus field valid, when set }
  738.                                                                         {         bit 5 - atapcPin field valid, when set }
  739.                                                                         {         bit 6 - atapcCopy field valid, when set }
  740.                                                                         {         bit 7 - atapcConfigIndex field valid, when set }
  741.                                                                         {         bits 14-8 - Reserved }
  742.                                                                         {         bit 15 - device lock/unlock request (write only) }
  743.         ataRWMultipleCount:        UInt16;                                    {  Reserved for future (not supported yet) }
  744.         ataSectorsPerCylinder:    UInt16;                                    {  Reserved for future (not supported yet) }
  745.         ataHeads:                UInt16;                                    {  Reserved for future (not supported yet) }
  746.         ataSectorsPerTrack:        UInt16;                                    {  Reserved for future (not supported yet) }
  747.         ataSocketNumber:        UInt16;                                    {  <--: Socket number used by the CardServices }
  748.                                                                         {         0xFF = socket number invalid (Not a CardServices device) }
  749.                                                                         {         other = socket number of the device }
  750.         ataSocketType:            SInt8;                                    {  <--: Specifies the socket type (get config only) }
  751.                                                                         {         00 = Unknown socket }
  752.                                                                         {          01 = Internal ATA bus }
  753.                                                                         {         02 = Media Bay }
  754.                                                                         {         03 = PCMCIA }
  755.         ataDeviceType:            SInt8;                                    {  <--: Specifies the device type (get config only) }
  756.                                                                         {         00 = Unknown device }
  757.                                                                         {         01 = standard ATA device (HD) }
  758.                                                                         {         02 = ATAPI device }
  759.                                                                         {         03 = PCMCIA ATA device }
  760.         atapcAccessMode:        SInt8;                                    {  <->: Access mode: Memory vs. I/O (PCMCIA only) }
  761.         atapcVcc:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  762.         atapcVpp1:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  763.         atapcVpp2:                SInt8;                                    {  <->: Voltage in tenths of a volt (PCMCIA only) }
  764.         atapcStatus:            SInt8;                                    {  <->: Card Status register setting (PCMCIA only) }
  765.         atapcPin:                SInt8;                                    {  <->: Card Pin register setting (PCMCIA only) }
  766.         atapcCopy:                SInt8;                                    {  <->: Card Socket/Copy register setting (PCMCIA only) }
  767.         atapcConfigIndex:        SInt8;                                    {  <->: Card Option register setting (PCMCIA only) }
  768.         ataSingleDMASpeed:        SInt8;                                    {  <->: Single Word DMA Timing Class }
  769.         ataMultiDMASpeed:        SInt8;                                    {  <->: Multiple Word DMA Timing Class }
  770.         ataPIOCycleTime:        UInt16;                                    {  <->:Cycle time for PIO mode }
  771.         ataMultiCycleTime:        UInt16;                                    {  <->:Cycle time for Multiword DMA mode }
  772.         Reserved1:                ARRAY [0..6] OF UInt16;                    {  Reserved for future }
  773.     END;
  774.  
  775. {  Get Card Location Icon/Text    <SM4> }
  776.  
  777. CONST
  778.     kATALargeIconHFS            = $0001;                        {  Large B&W icon with mask (HFS) }
  779.     kATALargeIconProDOS            = $0081;                        {  Large B&W icon with mask (ProDOS) }
  780.  
  781. {  Manager parameter block structure }
  782.  
  783. TYPE
  784.     ataLocationDataPtr = ^ataLocationData;
  785.     ataLocationData = RECORD
  786.                                                                         {  Start of cloned common header ataPBHdr }
  787.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  788.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  789.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  790.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  791.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  792.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  793.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  794.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  795.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  796.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  797.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  798.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  799.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  800.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  801.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  802.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  803.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  804.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  805.                                                                         {  End of cloned common header ataPBHdr }
  806.         ataIconType:            SInt16;                                    {  -->: icon type specifier }
  807.                                                                         {          1 = Large B&W icon with mask (256 bytes) }
  808.                                                                         {         0x81 = Same as 1, but ProDOS icon }
  809.         ataIconReserved:        SInt16;                                    {  Reserved to be longword aligned }
  810.         ataLocationIconPtr:        Ptr;                                    {  -->: Icon Data buffer pointer }
  811.         ataLocationStringPtr:    Ptr;                                    {  -->: Icon String buffer pointer }
  812.         Reserved1:                ARRAY [0..17] OF UInt16;                {  Reserved for future }
  813.     END;
  814.  
  815. {  ataOSType available }
  816.  
  817. CONST
  818.     kATAddTypeMacOS                = $0001;                        {  Blue Mac O/S ddType value }
  819.  
  820. {  The parameter block definition for all other ATA Manager functions. }
  821.  
  822.  
  823. TYPE
  824.     ataGenericPtr = ^ataGeneric;
  825.     ataGeneric = RECORD
  826.                                                                         {  Start of cloned common header ataPBHdr }
  827.         ataPBLink:                ataPBHeaderPtr;                            {  a pointer to the next entry in the queue     }
  828.         ataPBQType:                UInt16;                                    {  type byte for safety check }
  829.         ataPBVers:                SInt8;                                    {  -->: parameter block version number; Must be 0x01 }
  830.         ataPBReserved:            SInt8;                                    {  Reserved                                         }
  831.         ataPBReserved2:            Ptr;                                    {  Reserved                                         }
  832.         ataPBCallbackPtr:        ProcPtr;                                {  -->: Completion Routine Pointer     }
  833.         ataPBResult:            OSErr;                                    {  <--: Returned result                 }
  834.         ataPBFunctionCode:        SInt8;                                    {  -->: Manager Function Code  }
  835.         ataPBIOSpeed:            SInt8;                                    {  -->: I/O Timing Class             }
  836.         ataPBFlags:                UInt16;                                    {  -->: Various control options     }
  837.         ataPBReserved3:            SInt16;                                    {  Reserved                                         }
  838.         ataPBDeviceID:            UInt32;                                    {  -->: Device identifier             }
  839.         ataPBTimeOut:            UInt32;                                    {  -->: Transaction timeout value    in msec  }
  840.         ataPBClientPtr1:        Ptr;                                    {  Client's storage Ptr 1      }
  841.         ataPBClientPtr2:        Ptr;                                    {  Client's storage Ptr 2      }
  842.         ataPBState:                UInt16;                                    {  Reserved for Manager; Initialize to 0  }
  843.         ataPBSemaphores:        UInt16;                                    {  Used internally by the manager }
  844.         ataPBReserved4:            SInt32;                                    {  Reserved                                         }
  845.                                                                         {  End of cloned common header ataPBHdr }
  846.         Reserved:                ARRAY [0..23] OF UInt16;                {  Reserved for future }
  847.     END;
  848.  
  849.     ataPBPtr = ^ataPB;
  850.     ataPB = RECORD
  851.         CASE INTEGER OF
  852.         0: (
  853.             ataIOParamBlock:    ataIOPB;                                {  parameter block for I/O }
  854.             );
  855.         1: (
  856.             ataBIParamBlock:    ataBusInquiry;                            {  parameter block for bus inquiry }
  857.             );
  858.         2: (
  859.             ataMIParamBlock:    ataMgrInquiry;                            {  parameter block for Manager inquiry }
  860.             );
  861.         3: (
  862.             ataAbortParamBlock:    ataAbort;                                {  parameter block for abort }
  863.             );
  864.         4: (
  865.             ataDRParamBlock:    ataDrvrRegister;                        {  parameter block for driver register }
  866.             );
  867.         5: (
  868.             ataMEParamBlock:    ataModifyEventMask;                        {  parameter block for event mask modify }
  869.             );
  870.         6: (
  871.             ataRAParamBlock:    ataRegAccess;                            {  parameter block for register access }
  872.             );
  873.         7: (
  874.             ataDIParamBlock:    ataIdentify;                            {  parameter block for drive identify }
  875.             );
  876.         8: (
  877.             ataDCParamBlock:    ataDevConfiguration;                    {  parameter block for device configuration }
  878.             );
  879.         9: (
  880.             ataLDParamBlock:    ataLocationData;                        {  parameter block for location icon data }
  881.             );
  882.                                                                         { ataManagerInit    ataInitParamBlock;        // parameter block for Manager initialization }
  883.                                                                         { ataManagerShutDn    ataSDParamBlock;        // parameter block for Manager shutdown }
  884.                                                                         { ataDrvrLoad        ataDLParamBlock;        // parameter block for Driver loading }
  885.         10: (
  886.             ataGenericParamBlock: ataGeneric;                            {  parameter block for all other functions }
  887.             );
  888.     END;
  889.  
  890. {  The ATA Event codes… }
  891.  
  892. CONST
  893.     kATANullEvent                = $00;                            {  Just kidding -- nothing happened }
  894.     kATAOnlineEvent                = $01;                            {  An ATA device has come online }
  895.     kATAOfflineEvent            = $02;                            {  An ATA device has gone offline }
  896.     kATARemovedEvent            = $03;                            {  An ATA device has been removed from the bus }
  897.     kATAResetEvent                = $04;                            {  Someone gave a hard reset to the drive }
  898.     kATAOfflineRequest            = $05;                            {  Someone requesting to offline the drive }
  899.     kATAEjectRequest            = $06;                            {  Someone requesting to eject the drive }
  900.     kATAUpdateEvent                = $07;                            {  Potential configuration change reported by CardServices <SM4> }
  901.     kATATaskTimeRequest            = $08;                            {  The manager is requesting to be called at Task Time }
  902.     kATALoadDriverNow            = $09;                            {  Load the driver for the given bus immediately }
  903.                                                                 {  The following describes bit definitions in the eventMask field of ataDrvrRegister }
  904.     bATANullEvent                = $01;                            {  null event bit }
  905.     bATAOnlineEvent                = $02;                            {  online event bit }
  906.     bATAOfflineEvent            = $04;                            {  offline event bit }
  907.     bATARemovedEvent            = $08;                            {  removed event bit }
  908.     bATAResetEvent                = $10;                            {  reset event bit }
  909.     bATAOfflineRequest            = $20;                            {  offline request event bit }
  910.     bATAEjectRequest            = $40;                            {  eject request event bit }
  911.     bATAUpdateEvent                = $80;                            {  configuration update event bit }
  912.  
  913.     kATAEventMarker                = 'LOAD';                        {  Marker for the event data structure }
  914.     kATAEventVersion1            = $00000001;                    {  Version 1 of the event structure }
  915.  
  916.  
  917. TYPE
  918.     ATADispatchProcPtr = ProcPtr;  { FUNCTION ATADispatch(VAR pb: ataPB): OSErr; }
  919.  
  920.     ATADispatchUPP = UniversalProcPtr;
  921.  
  922. CONST
  923.     uppATADispatchProcInfo = $000000E0;
  924.  
  925. FUNCTION NewATADispatchProc(userRoutine: ATADispatchProcPtr): ATADispatchUPP;
  926.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  927.     INLINE $2E9F;
  928.     {$ENDC}
  929.  
  930. FUNCTION CallATADispatchProc(VAR pb: ataPB; userRoutine: ATADispatchUPP): OSErr;
  931.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  932.     INLINE $205F, $4E90;
  933.     {$ENDC}
  934. FUNCTION ataManager(VAR pb: ataPB): SInt16;
  935.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  936.     INLINE $AAF1;
  937.     {$ENDC}
  938. { Device Error codes: 0xDB42 - 0xDB5F    }
  939.  
  940.  
  941. CONST
  942.     ATABaseErrCode                = -9406;                        {  Base error code - 0xDB42     }
  943.     ioPending                    = 1;                            {  Asynch I/O in progress status }
  944.     AT_NRdyErr                    = -9405;                        {  0xDB43: Drive not Ready  }
  945.     AT_IDNFErr                    = -9404;                        {  0xDB44: ID not found  }
  946.     AT_DMarkErr                    = -9403;                        {  0xDB45: Data mark not found  }
  947.     AT_BadBlkErr                = -9402;                        {  0xDB46: Bad Block  }
  948.     AT_CorDataErr                = -9401;                        {  0xDB47: Data was corrected  }
  949.     AT_UncDataErr                = -9400;                        {  0xDB48: Data was not corrected  }
  950.     AT_SeekErr                    = -9399;                        {  0xDB49: Seek error  }
  951.     AT_WrFltErr                    = -9398;                        {  0xDB4A: Write fault  }
  952.     AT_RecalErr                    = -9397;                        {  0xDB4B: Recalibrate failed  }
  953.     AT_AbortErr                    = -9396;                        {  0xDB4C: Command aborted by drive  }
  954.     AT_MCErr                    = -9394;                        {  0xDB4E: Media Changed error }
  955.     ATAPICheckErr                = -9393;                        {  0xDB4F: ATAPI Check condition <06/15/94> }
  956.                                                                 {  System error codes...Custom Driver Error Codes 0xDB60 - 0xDB6F }
  957.     DRVRCantAllocate            = -9376;                        {  0xDB60: Allocation error during initialization }
  958.     NoATAMgr                    = -9375;                        {  0xDB61: MgrInquiry failed => No ATA Manager }
  959.     ATAInitFail                    = -9374;                        {  0xDB62: Mgr Initialization failed }
  960.     ATABufFail                    = -9373;                        {  0xDB63: Device buffer test failure }
  961.     ATADevUnsupported            = -9372;                        {  0xDB64: Device type not supported }
  962.     ATAEjectDrvErr                = -9371;                        {  0xDB65: Could not eject the drive }
  963.                                                                 {  Manager Error Codes 0xDB70 - 0xDB8F }
  964.     ATAMgrNotInitialized        = -9360;                        {  0xDB70: Mgr has not been initialized }
  965.     ATAPBInvalid                = -9359;                        {  0xDB71: The bus base address couldn't be found }
  966.     ATAFuncNotSupported            = -9358;                        {  0xDB72: An unknown function code specified }
  967.     ATABusy                        = -9357;                        {  0xDB73: Selected device is busy }
  968.     ATATransTimeOut                = -9356;                        {  0xDB74: Transaction timeout detected }
  969.     ATAReqInProg                = -9355;                        {  0xDB75: Channel busy; channel is processing another cmd }
  970.     ATAUnknownState                = -9354;                        {  0xDB76: Device status register reflects an unknown state }
  971.     ATAQLocked                    = -9353;                        {  0xDB77: I/O Queue is locked due to previous I/O error. }
  972.     ATAReqAborted                = -9352;                        {  0xDB78: The I/O queue entry was aborted due to an abort req. }
  973.                                                                 {             or due to Manager shutdown. }
  974.     ATAUnableToAbort            = -9351;                        {  0xDB79: The I/O queue entry could not be aborted. }
  975.     ATAAbortedDueToRst            = -9350;                        {  0xDB7A: Request aborted due to a device reset command. }
  976.     ATAPIPhaseErr                = -9349;                        {  0xDB7B: Unexpected phase - •••IS THIS VALID ERROR??? <06/15/94> }
  977.     ATAPITxCntErr                = -9348;                        {  0xDB7C: Overrun/Underrun condition detected }
  978.     ATANoClientErr                = -9347;                        {  0xDB7D: No client present to handle the event }
  979.     ATAInternalErr                = -9346;                        {  0xDB7E: MagnumOpus returned an error }
  980.     ATABusErr                    = -9345;                        {  0xDB7F: Bus error detected on I/O     }
  981.     AT_NoAddrErr                = -9344;                        {  0xDB80: Invalid AT base adress  }
  982.     DriverLocked                = -9343;                        {  0xDB81: Current driver must be removed before adding another }
  983.     CantHandleEvent                = -9342;                        {  0xDB82: Particular event couldn't be handled (call others) }
  984.     ATAMgrMemoryErr                = -9341;                        {  0xDB83: Manager memory allocation error     }
  985.     ATASDFailErr                = -9340;                        {  0xDB84: Shutdown failure                 }
  986.     ATAXferParamErr                = -9339;                        {  0xDB85: I/O xfer parameters inconsistent  }
  987.     ATAXferModeErr                = -9338;                        {  0xDB86: I/O xfer mode not supported  }
  988.     ATAMgrConsistencyErr        = -9337;                        {  0XDB87: Manager detected internal inconsistency.  }
  989.     ATADmaXferErr                = -9336;                        {  0XDB88: fatal error in DMA side of transfer  }
  990.                                                                 {  Driver loader error Codes 0xDB90 - 0xDBA5 }
  991.     ATAInvalidDrvNum            = -9328;                        {  0xDB90: Invalid drive number from event }
  992.     ATAMemoryErr                = -9327;                        {  0xDB91: Memory allocation error }
  993.     ATANoDDMErr                    = -9326;                        {  0xDB92: No DDM found on media     }
  994.     ATANoDriverErr                = -9325;                        {  0xDB93: No driver found on the media     }
  995.  
  996. { ------------------------    Version 1 definition -------------------------------    }
  997.     v1ATABaseErrCode            = $0700;                        {  This needs a home somewhere }
  998.     v1AT_NRdyErr                = $FFFFF901;                    {  0xF901: -0x1DBE  }
  999.     v1AT_IDNFErr                = $FFFFF904;                    {  0xF904: -0x1DC0  }
  1000.     v1AT_DMarkErr                = $FFFFF905;                    {  0xF905: -0x1DC0  }
  1001.     v1AT_BadBlkErr                = $FFFFF906;                    {  0xF906: -0x1DC0  }
  1002.     v1AT_CorDataErr                = $FFFFF907;                    {  0xF907: -0x1DC0  }
  1003.     v1AT_UncDataErr                = $FFFFF908;                    {  0xF908: -0x1DC0  }
  1004.     v1AT_SeekErr                = $FFFFF909;                    {  0xF909: -0x1DC0  }
  1005.     v1AT_WrFltErr                = $FFFFF90A;                    {  0xF90A: -0x1DC0  }
  1006.     v1AT_RecalErr                = $FFFFF90B;                    {  0xF90B: -0x1DC0  }
  1007.     v1AT_AbortErr                = $FFFFF90C;                    {  0xF90C: -0x1DC0  }
  1008.     v1AT_NoAddrErr                = $FFFFF90D;                    {  0xF90D: -0x1D8D  }
  1009.     v1AT_MCErr                    = $FFFFF90E;                    {  0xF90E: -0x1DC0 }
  1010.                                                                 {  System error codes...Custom Driver Error Codes }
  1011.     v1DRVRCantAllocate            = -1793;                        {  0xF8FF: -0x1D9F }
  1012.     v1NoATAMgr                    = -1794;                        {  0xF8FE: -0x1D9D }
  1013.     v1ATAInitFail                = -1795;                        {  0xF8FD: -0x1D9B }
  1014.     v1ATABufFail                = -1796;                        {  0xF8FC: -0x1D99 }
  1015.     v1ATADevUnsupported            = -1797;                        {  0xF8FB: -0x1c97 }
  1016.                                                                 {  Manager Error Codes }
  1017.     v1ATAMgrNotInitialized        = -1802;                        {  0xF8F6: -0x1D86 }
  1018.     v1ATAPBInvalid                = -1803;                        {  0xF8F5: -0x1D84 }
  1019.     v1ATAFuncNotSupported        = -1804;                        {  0xF8F4: -0x1D82 }
  1020.     v1ATABusy                    = -1805;                        {  0xF8F3: -0x1D80 }
  1021.     v1ATATransTimeOut            = -1806;                        {  0xF8F2: -0x1D7E }
  1022.     v1ATAReqInProg                = -1807;                        {  0xF8F1: -0x1D7C }
  1023.     v1ATAUnknownState            = -1808;                        {  0xF8F0: -0x1D7A }
  1024.     v1ATAQLocked                = -1809;                        {  0xF8EF: -0x1D78 }
  1025.     v1ATAReqAborted                = -1810;                        {  0xF8EE: -0x1D76 }
  1026.     v1ATAUnableToAbort            = -1811;                        {  0xF8ED: -0x1D74 }
  1027.     v1ATAAbortedDueToRst        = -1812;                        {  0xF8EC: -0x1D72 }
  1028.  
  1029.  
  1030. {$ALIGN RESET}
  1031. {$POP}
  1032.  
  1033. {$SETC UsingIncludes := ATAIncludes}
  1034.  
  1035. {$ENDC} {__ATA__}
  1036.  
  1037. {$IFC NOT UsingIncludes}
  1038.  END.
  1039. {$ENDC}
  1040.